package day6;

public class Demo3 {

    static abstract class Composition {
        void dowork() {
            System.out.println("准备纸和笔");
            write();
            System.out.println("收笔");
        }

        abstract void write();
    }

    static class XiaoMing extends Composition{

        @Override
        void write() {
            System.out.println("题目:我的爸爸是市长");
        }
    }

    public static void main(String[] args) {
        Composition xiaoMing = new XiaoMing();
        xiaoMing.dowork();
    }
}
